import fs from "fs";
export default function AutoRoutePlugin(app, opt, next) {
  const { dir } = opt;
  fs.readDir(dir, (err, files) => {
    console.log(
      "%c 🐛[  ]-6",
      "font-size:13px; background:#1460d8; color:#58a4ff;",
      files
    );
  });
  loader().then((mod) => {
    Object.keys(mod).forEach((key) => {
      const reg = /(get|post|put|delete|options|head)(\w\W+)/g;
      const match = key.match(reg);

      console.log(
        "%c 🐛[  ]-9",
        "font-size:13px; background:#0781ed; color:#4bc5ff;",
        match
      );

      if (match) {
      }

      next();
    });
  });
}
